﻿<div class="answersys">
	<h3>答疑系统</h3>
	<a href="<?php echo $this->baseUrl().'/answersystem/index';?>" id="more" name="more">更多>></a>
	<ul>
		<?php
			if(isset($this->allapp)&&$this->userjob=='others')
			{
			    foreach($this->allapp as $app)
			    {
			    	if($app['status']!=1)
			    	{
			    		echo '<li><a href="'.$this->baseUrl().'/answersystem/studentdetail?id='.$app['id'].'">'.$this->collegearray[$app['college']].$app['teacher'].'老师';
			    		if($app['status']==3)echo '【决定';
			    		else echo '【准备';
			    		echo '】在'.gmdate('Y年m月d日H:i',$app['date']).'答疑-'.$app['class'].'</a></li>';
			    	}
			    }
			}
			else if(isset($this->allapp)&&$this->userjob=='teacher')
			{
			    foreach($this->allapp as $app)
			    {
			    	if($app['status']!=1)
			    	{
			    		echo '<li><a href="'.$this->baseUrl().'/answersystem/teacherdetail?id='.$app['id'].'">'.'您';
			    		if($app['status']==3)echo '【决定';
			    		else echo '【准备';
			    		echo '】在'.gmdate('Y年m月d日H:i',$app['date']).'答疑['.$app['class'].']有'.$app['countstudent'].'位同学登记'.'</a></li>';
			    	}
			    }
			}
			
			//<li><a href="">计算机学院zhijian老师【决定】在2012年08月15日09:00答疑-电子技术</a></li>
		?>
			
		</ul>
</div>
<div class="recentact">
	<h3>近期活动</h3>
	<a href="<?php echo $this->baseUrl().'/recentact/index';?>" id="more" name="more">更多>></a>
	<ul>
		<!--   
		<li>
		<a href="<?php echo $this->baseUrl().'/recentact/detail'?>" id="title" name="title">
		我是公主，计算机学院系列活动,我是公主，计算机学院系列活动
		</a>
		<div class="progressbar">
			<div class="red" style="width:70%">
			</div>
		</div>
		<div class="zan">
			[2012.7.5]好评70%
		</div>
		</li>
 		-->
		<?php
			foreach($this->allacts as $act)
			{
			    $countall = $act['countgood']+$act['countsoso']+$act['countbad'];
			    if($countall==0)$goodrate = 0;
			    else $goodrate = round(100*floatval($act['countgood'])/$countall);
			    echo '<li>
			    	  <a href="'.$this->baseUrl().'/recentact/detail?actid='.$act['id'].'" id="title" name="title">';
			    echo $act['title'];
			    echo '</a>
			    	  <div class="p"><div class="progressbar">
			    	  	<div class="red" style="width:';
			    echo $goodrate.'%">';
			    echo '  </div>
			    	  </div>
			    	  <div class="zan">';
			    echo '['.gmdate('Y-m-d',$act['date']+8*3600).']';
			    echo '好评'.$goodrate.'%
			    	  </div>
			    	  </div>
			    	  </li>';
			} 
		?>
	</ul>
</div>
<div class="forum">
	<h3>学习论坛</h3>
	<a id="more" name="more"href="<?php echo $this->baseUrl().'/forum/index/';?>">更多>></a>
		<ul>
		<?php
			if(isset($this->allforums))
				foreach($this->allforums as $forum)
				{
				   
				    
			        echo '<li><div class="count" title="';
			        if($forum['replytoid']==0)
			        {
			            echo $forum['countreply'];
			            echo '">'.$forum['countreply'].'</div>';
			        }
			        else
			        {
			            echo '本帖是回复贴';
			            echo '">'.'回复贴'.'</div>';
			        }
				    echo '<div class="content"><div class="ti"><a href="';
				    if($forum['replytoid']==0)echo $this->baseUrl().'/forum/detail?forumid='.$forum['id'].'">';
				    else echo $this->baseUrl().'/forum/detail?forumid='.$forum['replytoid'].'">';
				    echo $this->escape($forum['title']).'</a></div>'.'<div class="content">';
				    echo $this->escape($forum['content']).'</div></div><div class="author"><p>by  ';
				    echo $this->escape($forum['author']).'</p><p>';
				    date_default_timezone_set("Asia/Shanghai");
				    echo gmdate('Y-m-d',$forum['time']).'</p></div></li>';
				} 
		?>
		</ul>
</div>
<div class="download">
	<h3>资源下载</h3>
	<a id="more" name="more" href="<?php echo $this->baseUrl().'/download/index';?>">更多>></a>
	<ul>
	<?php 
	foreach($this->allfiles as $file)
			{
			    //print_r($file);
			    $href = $this->baseUrl().'/download/download?fileid='.$file['id'];
			    echo "<li><a href=$href>";
			    echo $file['filename'];
			    echo "</a><div class=\"date\">[";
			    echo $file['uploader'];
			    echo "][";
			    echo gmdate('Y-m-d',$file['filedate']);
			    echo "]</div></li>";
			} 
	?>
	</ul>
</div>